package com.mobilous.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.TextBox;
import com.mobilous.client.MainScreen.MainPage;

public class AppexeLogin extends Composite {

	public AppexeLogin() {
		
		AbsolutePanel absolutePanel = new AbsolutePanel();
		absolutePanel.setStyleName("MainWindow");
		initWidget(absolutePanel);
		StaticData.absolutePanel=absolutePanel;
		
		absolutePanel.setSize("1024px", "768px");
		Image image = new Image("images/loginimage.jpg");
		absolutePanel.add(image, 0, 0);
		image.setSize("1024px", "768px");
		final TextBox textBox = new TextBox();
		absolutePanel.add(textBox, 841, 630);
		textBox.setSize("159px", "18px");
		
		final PasswordTextBox passwordTextBox = new PasswordTextBox();
		absolutePanel.add(passwordTextBox, 841, 694);
		passwordTextBox.setSize("163px", "16px");
		
		Button btnNewButton = new Button("Login Button");
		btnNewButton.setText("Login");
		absolutePanel.add(btnNewButton, 963, 728);
		
		Label lblUsername = new Label("Username");
		absolutePanel.add(lblUsername, 841, 607);
		
		Label lblPassword = new Label("Password");
		absolutePanel.add(lblPassword, 841, 670);
		
		btnNewButton.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				if(textBox.getText().equals("mobilous")&&passwordTextBox.getText().equals("mobilous123"))
				{
					new MainPage();
				}
			}
		});
        
		ListBox comboBox = new ListBox();
		comboBox.addItem("English");
		comboBox.addItem("Japanese");
		comboBox.addItem("Spanish");
		comboBox.addItem("Italian");
		StaticData.absolutePanel.add(comboBox, 903, 10);
		comboBox.setSize("107px", "22px");
	}
}
